//Team: T102-17 
//Members: wrr3hw/ William Rinaldi; atb3df/ Austin Beane; cea7dz/ Katie Aichholz; jpp7mt/Jessica Platter

package cs2110.virginia.edu.ghosthunter;

public class Ghost {
	private int x;
	private int y;
	private int vx;
	private int vy;
	public Ghost(int a, int b, int c, int d) {
		this.x=a;
		this.y=b;
		this.vx=c;
		this.vy=d;
	}
	
	public int getx(){
		
		if(x>=630){
			this.setx(600);
			this.setvx(-vx);
		}
		if(x<=0){
			this.setx(30);
			this.setvx(-vx);
		}			
		return x;

	}
	public int gety(){
		if (y >= 850) {
			this.sety(820);
			this.setvy(-vy);
		}
		if(y<=0){
			this.sety(30);
			this.setvy(-vy);
		}
		
		return y;
	}
	public void setx(int a){
		this.x=a;
		
	}
	public void sety(int b){
		this.y=b;
		
	}
	public int getvx(){
		return vx;
	}
	public int getvy(){
		return vy;
	}
	public void setvx(int a){
		vx = a;
	}
	public void setvy(int b){
		vy = b;
	}
	public void destroy(){
		if(Math.abs(this.getx()-Drawer.bill.getx())<=30&&Math.abs(this.gety()-Drawer.bill.gety())<=30){
				this.setvx(-vx);
			
//			this.setx(10000);
//			this.sety(10000);
//			this.setvx(0);
//			this.setvy(0);
		}
	}
	
}
